package com.kunbo.cn.entity.system;
import javax.persistence.JoinTable;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name="sys_menu")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@EntityListeners(AuditingEntityListener.class)
@Data
public class SysPermission implements Serializable{

	/** serialVersionUID*/
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(generator = "jpa-uuid")
    @Column(length = 32)
	private String id;//主键uuid
	
	private String name;// 名称.  
	  
    @Column(columnDefinition = "enum('menu','button')")  
    private String resourceType;// 资源类型，[menu|button]  
    private String url;// 资源路径.  
    private String permission; // 权限字符串,menu例子：role:*，button例子：role:create,role:update,role:delete,role:view  
    private Long parentId; // 父编号  
    private String parentIds; // 父编号列表  
    private Boolean available = Boolean.FALSE;  
  
//  @ManyToMany(fetch = FetchType.LAZY)  
//  @JoinTable(name = "SysRolePermission", joinColumns = { @JoinColumn(name = "permissionId") }, inverseJoinColumns = {  
//  @JoinColumn(name = "roleId") }) 
//  private List<SysRole> roles;  
    
    @CreatedDate
    private Date createTime;//创建时间
    @LastModifiedDate
    private Date lastModifiedTime;//修改时间

}
